<template>
	<view class="main addressDetails-main">
		<NavigationBar title="收货地址" />
		<view class="scroll-wrap">
			<view class="cell">
				<view class="cell-item b-b">
					<text class="label">收货人</text>
					<input class="input" placeholder-class=" placeholder" placeholder="请输入收货人姓名" />
				</view>
				<view class="cell-item b-b">
					<text class="label">手机号</text>
					<input class="input" placeholder-class=" placeholder" placeholder="请输入收货人手机号码" />
				</view>
				<view class="cell-item b-b" @click="getMapsAction">
					<text class="label">地址</text>
					<text class="address-text">请在地图选择收货地址</text>
					<text class="iconfont rigt-arrow-icon">&#xe60a;</text>
				</view>
				<view class="cell-item b-b">
					<text class="label">设为默认地址</text>
					<switch class="default-switch" checked color="#fa2c19" @change="switch1Change" />
				</view>
			</view>
			<view class="footer-wrap">
				<view class="submit-btn-wrap">
					<view class="submit-btn flex-center" @click="submitAction">
						<text class="btn-text">提交</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		methods: {
			switch1Change: function(e) {
				console.log('值为', e.target.value)
			},
			getMapsAction() {
				const _this = this
				uni.chooseLocation({
					latitude: 24.482633,
					longitude: 118.180938,
				    success: function (res) {
				        console.log('位置名称：' + res.name);
				        console.log('详细地址：' + res.address);
				        console.log('纬度：' + res.latitude);
				        console.log('经度：' + res.longitude);
						
				    }
				});
			},
			submitAction: function() {
				console.log('=========')
			}
		}
	}
</script>

<style lang="scss">
	@import "./addressDetails.scss";
</style>
